package org.example.anonymous;

/**
 * 演示匿名内部类
 *
 */
public class Test01 {


    public static void main(String[] args) {
        //匿名实现
        Thread t1 = new Thread(()->
                //lambda写法
                System.out.println("子线程runing"));
        t1.start();


        //非匿名实现
        Thread t2 = new Thread(new ThreadTarget());
        t2.start();
    }




    public static class ThreadTarget implements Runnable {

        @Override
        public void run() {
            System.out.println("正在运行");
        }
    }
}
